***
***
*** This Program already converted to Y2K
*** S&T Departement     on 29 April 1999 by Ben.Rahman
***
***
*** Pharmacy in AREA - Pharmacy (PC)

set cent on
SET COLO TO BG+/B
CLEAR
SET PROC TO SOSPRO1
SET PROC TO BOXPROC
SET PROC TO LABPROC
STORE ' ' TO AEANAME,AEAADDR,AEACITY,AEACOUN,AEACURR,AEASTNM
STORE .F. TO AEAHEAL,AEADECI,AEASITE
DO START
REST FROM  N:VISPHA addi
PUBLIC VISPH
DR="N:"
DOI=DATE()
store 0 to SWW,sww1,sww2,sww3,cr1,cnt1,PL1,PL2,PL3,PL4,PL5,PL6,PL7,PL8,PL9,PL10,pl11,pl12,PL13,PL14,PL15,PL16,PL17,PL18
store 0 to ndrug, NDISP

**Start Firisco 29 Jan 2003: store 0 to nVAT and totVAT
store 0 to nVAT,totVAT,totHLVAT
**End Firisco 29 Jan 2003: store 0 to nVAT and totVAT

STORE .F. TO PATIN,FRUSEL,COMPLT,termin,patid
TGLL=SUBSTR(DTOC(DOI),1,2)
DO WHILE .NOT. PATIN .AND. SWW<3 .AND. LASTKEY()<>27
   SET COLOR TO BG+/B
   @ 0,0 CLEA TO 24,79
   STORE 0 TO TOTL,NPROC,TOTPAY,TOTHL,TOTFEE,TOTPROC,NORE,DQNT,PTOTL,PILC,MTOTL
   STORE SPACE(6) TO KDPAT,KODE
   STORE SPACE(1) TO TPPAT,CRPAT,MNMPAT,ISEX,CORP
   STORE SPACE(4) TO DTPAT, COPAT
   STORE SPACE(8) TO MDSNBR
   STORE SPACE(16) TO NMPAT,FNMPAT,NATIO,DEPPER
   STORE CTOD('  /  /    ') TO DOBPAT,HLBEGIN,MDSDAT
   STORE .F. TO HEALTH, HLRES, HLVOID,PERSO,FAMIL,MDS,PREND
   HLDATE=DATE()
   F1='IN_PAT'
   f2='PHARMACY'
   SELE 1
   SET EXCLU OFF
   USE &DR&F1
   DO ADDRESSC
   DO BOXT WITH 3,29,' P H A R M A C Y ','W+','B',.F.,.T.
   SET COLO TO BG+/B
   @ 6, 3 SAY "SURNAME :"
   @ 6,30 SAY "FIRST NAME :"
   @ 6,60 SAY "MID.INITIAL :"
   @ 7, 3 SAY "DATE OF BIRTH :"
   @ 7,29 SAY "NATIONALITY :"
   @ 7,62 SAY "SEX (M/F) :"
   DO BOXE WITH 3,52,'PATIENT CODE :','KODE','GR+','R','N','W+',6,.F.,.T.
   SET COLO TO BG+/B,W+/N
   IPPAT=.F.
   SELE 1
   LOCA FOR PAT_FILCOD=KODE
   IF .NOT. FOUND()
      SWW=SWW+1
      SET COLO TO BG+/B*
      set cons off
      DO BOXF WITH 14,17,'>>>>> WRONG CODE, PLEASE ENTER AGAIN <<<<<','GR+','R','GR+*',.T.,.T.
      WAIT ' '
      set cons on
      SET COLO TO BG+/B
      @ 14,17 CLEA TO 23,78
      PATID=.F.
   ELSE
      PATID=.T.
   ENDIF
   IF PATID
      DO cashipat
      DO BOX2 WITH 20,20,'DO YOU WANT TO :','CONFIRM','CANCEL','W+','B','GR+','N',PL1,.T.,.T.
      IF PL1=1
         PATIN=.T.
      ENDIF
   ENDIF
ENDDO
IF .NOT. PATIN
   RETURN
ENDIF
nore=recno()
f2='PHARMACY'
fill='\temp\la'+kdpat+'.dbf'
film='\temp\ME'+kdpat+'.dbf'
filp='\temp\ph'+kdpat+'.dbf'
*IF FILE("&DR&FILM") .OR. FILE("&DR&FILP")
*   @ 10,1 CLEA TO 23,78
*   DO BOXT WITH 14,20,"   THIS FILE IS USED AT CASHIER STATION   ",'GR+','B',.F.,.F.
*   DO BOXT WITH 16,20,"YOU CANNOT PROCESS LABORATORY EXAMINATIONS",'GR+','B',.F.,.F.
*   DO BOXT WITH 18,20,"    PLEASE, RETURN THE FILE TO CASHIER    ",'GR+','B',.F.,.F.
*   DO BOXT WITH 20,20,"   AND,  TYPE ANY KEY TO RETURN TO MENU   ",'GR+','B',.F.,.F.
*   WAIT " "
*   CLEA
*   RETURN
*ENDIF

f6="\temp\PC"+kdpat
use &dr&f2
copy stru to &dr&f6
sele 6
use &dr&f6
SET COLOR TO BG+/B
@ 11,0 CLEAR to 24,79
VISPH=VISPH+1
NOBER=STR(VISPH,5)
STORE 0 TO TOTL,PHACNT

DO WHILE .NOT. COMPLT .AND. LASTKEY()<>27
   STORE .F. TO MRES,HRES
   STORE 0 TO PLAB,MLAB,HLAB,COSTAL,NUMB,pub
   set color to bg+/b
   @ 9,0 clea to 18,45
   @ 19,0 CLEA TO 24,79

   *start Firisco 29 Jan 2003: round up
   DO BOXT WITH 22,46,'TOTAL PAYABLE (Rp.) :'+TRANS(round(TOTL,0),'##,###,###'),'GR+','B',.F.,.T.
   *end Firisco 29 Jan 2003: round up

   ANOD=.T.
   do while anod
      set color to bg+/b
      @ 9,0 clea to 21,79
      @ 22,0 CLEA TO 24,45
      store space(5) to DRUGK,dispk
      store 0 to cntd,crd,DQNT
      STORE SPACE(5) TO DRUGIN,DISPIN
      store 1 to pil_WWC
      do box2 with 9,0,"DELIVERY OF :","MEDICATIONS (DRUGS)","DISPOSABLE ITEMS",'w+','bg','w+','n',pl6,.f.,.t.
      if PL6=1
         
         DO BOXE WITH 12,0,'Enter initial of Drug (trade name) to be dispensed :','drugin','GR+','R','N','W+',5,.T.,.T.
         
         f9='drugs'
         SELE 9
         set exclu off
         use &dr&f9 inde &dr&f9

         DO CASH405p
         if drugk=space(5)
            loop
         endif
         SET COLOR TO BG+/B
         @ 9,0 CLEA TO 21,79
         SELE 9
         set exclu off
         use &dr&f9 inde &dr&f9

         SEEK DRUGK
         IF .NOT. EOF()
            NMDR=DRUG_NAME
            TPDR=DRUG_TYPE
            SLUN=TRIM(SELL_UNIT)+' '+TRIM(DRUG_QANT)+' '+TRIM(DRUG_UNIT)
            SEUN=SELL_UNIT

	        IF TPPAT='0' .OR. TPPAT='9' .OR. TPPAT='G' .OR. TPPAT='S'
    	    	UNPR=EMP_PRICE
        	ELSE
				*start Firisco 10 May 2004: bila WWC members maka discount 5%
    	     	if drugk='A0188' .or. drugk='L5055'
	    	     	do box2 with 9,0,"Is the patient WWC members :","NO","YES",'w+','bg','w+','n',pil_WWC,.f.,.t.
	        	 	if pil_wwc=2
	         			UNPR=SALE_PRICE - (SALE_PRICE * 1)
		         	else
		         		UNPR=SALE_PRICE
	    	     	endif
    			else
    				UNPR=SALE_PRICE
	    		endif     	
    	     	*end Firisco 10 May 2004: bila WWC members maka discount 5%

         	ENDIF

            UNNI=DRUG_UNIT
            QANT=DRUG_QANT
            HLDR=HEALTHLINE

            DO BOXT WITH 9,0,ALLTRIM(NMDR)+' '+ALLTRIM(TPDR)+'  '+SLUN,'W+','B',.F.,.F.
            DO BOXT WITH 11,0,'Price (Rp.) :'+TRANS(unPR,'##,###,###')+' Per '+alltrim(seun),'W+','b',.F.,.T.
            DO BOXT WITH 11,56,SEUN,'bg+','B',.F.,.F.
            DO BOXN WITH 11,39,'Quantity : ','DQNT','999','BG+','B','W+','N','999','1',.F.,.F.
            DO BOXN WITH 11,39,'Quantity : ','DQNT','999','BG+','B','W+','N','999','1',.F.,.F.
            if dqnt=1
               DO BOXT WITH 11,56,SEUN,'bg+','B',.F.,.F.
            else
               DO BOXT WITH 11,56,alltrim(SEUN)+'s','bg+','B',.F.,.F.
            endif
            TOTPR=UNPR*DQNT
            DO BOXT WITH 14,0,'TOTAL PRICE (Rp.) :'+TRANS(TOTPR,'##,###,###'),'W+','R',.F.,.T.
            do box2 with 14,40,'Do You Want To :','CONFIRM','MODIFY','gr+','r','W+','N',PL7,.F.,.t.
            IF PL7=2
               loop
            ELSE
               	NDRUG=NDRUG+1
				IF (TPPAT='0' .OR. TPPAT='9' .OR. TPPAT='G' .OR. TPPAT='S') .AND. KDPAT<>'P02465' .AND. KDPAT<>'P02466' .AND. KDPAT<>'P02523'
               		IF EMDR .and. (TPPAT='0' .OR. TPPAT='9' .OR. TPPAT='G')
                  		HLRES=.F.
                  		HPRIC=0
                  		PPRIC=0
                  		MPRIC=0
                  		MSRES=.F.
                  		nVAT=0
               		ELSE
                  		HLRES=.F.
                  		HPRIC=0
                  		PPRIC=TOTPR
                  		MPRIC=0
                  		MSRES=.F.
                  		nVAT=(1 * TOTPR)
               		ENDIF
            	ELSE
               		IF HEALTH .AND. .NOT. HLVOID
	                	IF HLDR .OR. ((DRUGK='H4037' .OR. DRUGK='H4031' .OR. DRUGK='H4034' .OR. DRUGK='H4033' .OR. ;
    	                   DRUGK='H4045' .OR. DRUGK='H4046' .OR. DRUGK='T4021' .OR. DRUGK='T4022') .AND. TPPAT='8')
		                	HLRES=.T.
    	             		HPRIC=TOTPR
        	         		PPRIC=0
            	     		MPRIC=0
                	 		MSRES=.F.
                	 		nVAT=(1 * TOTPR)
                  		ELSE
					 		*Start add by Firisco 22 Nov 2002: regarding Ben'email 21 Nov 2002 about Healthline Medical Plane
                  	 		if (DRUGK='H4033' .or. DRUGK='H4031' .or. DRUGK='H4034' .or. DRUGK='T4021' .or. DRUGK='T4022' .or.DRUGK='T4023') .and. CORP<>' ' .and. CORP<>'PRIVATE' .and. CORP<>'P R I V A T E' .and. COPAT<>'0000'
	                     		HLRES=.T.
    	                 		HPRIC=Totpr
        	             		PPRIC=0
            	         		MPRIC=0
                	     		MSRES=.F.  
                	     		nVAT=(1 * TOTPR)                	 
                  	 		*End add by Firisco 22 Nov 2002: regarding Ben'email 21 Nov 2002 about Healthline Medical Plane
                  	 		else
	                     		HLRES=.F.
    	                 		HPRIC=0
        	             		MPRIC=0
            	         		PPRIC=TOTPR
                	     		MSRES=.F.
                	     		nVAT=(1 * TOTPR)
                	 		endif
                  		ENDIF
               		ELSE
                  		IF MDS
                     		HLRES=.F.
                     		HPRIC=0
                     		PPRIC=0
                     		MPRIC=TOTPR
                     		MSRES=.T.
                     		nVAT=(1 * TOTPR)
                  		ELSE
                     		HLRES=.F.
                     		HPRIC=0
                     		MPRIC=0
                     		PPRIC=TOTPR
                     		MSRES=.F.
                     		nVAT=(1 * TOTPR)
                  		ENDIF
               		ENDIF
            	ENDIF
               	sele 6
               	DO phadr with 'PC'

	            *Start Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT
    	        if PPRIC<>0
	    	        TOTL=TOTL+PPRIC+nVAT
    	    	    PTOTL=PTOTL+PPRIC+nVAT
	            else
		            TOTL=TOTL+PPRIC
    		        PTOTL=PTOTL+PPRIC
    	    	endif
	    	    *End Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT

            endif
         ELSE
	        store space(25) to nmdr
    	    store space(16) to tpdr,slun,seun,unni,qant
        	store 0 to unpr,dqnt
	        store .f. to hldr,msdr
    	    DO BOXE  WITH 9,0,"DRUGS NAME :",'NMDR','BG+','B','W+','N',16,.F.,.F.
	        DO BOXN WITH 11,0,'Price (Rp.) : ','unpr','99,999,999','BG+','B','W+','N','10000000','0',.F.,.F.
    	    DO BOXN WITH 11,39,'Quantity : ','DQNT','999','BG+','B','W+','N','999','1',.F.,.F.
        	TOTPR=UNPR*DQNT
	        DO BOXT WITH 14,0,'TOTAL PRICE (Rp.) :'+TRANS(TOTPR,'##,###,###'),'W+','R',.F.,.T.
    	    do box2 with 14,40,'Do You Want To :','CONFIRM','MODIFY','gr+','r','W+','N',PL7,.F.,.t.
        	
			IF PL7=2
				loop
          	ELSE
            	HLRES=.F.
             	HPRIC=0
             	MPRIC=0
             	PPRIC=TOTPR
             	MSRES=.F.
             	nVAT=(1 * TOTPR)
          	ENDIF
          	SELE 6
          	DO phaDR with 'PC'

            *Start Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT
            if PPRIC<>0
	            TOTL=TOTL+PPRIC+nVAT
    	        PTOTL=PTOTL+PPRIC+nVAT
            else
	            TOTL=TOTL+PPRIC
    	        PTOTL=PTOTL+PPRIC
    	    endif
    	    *End Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT
  	    	
      	ENDIF

		*start Firisco 29 Jan 2003: round up
        DO BOXT WITH 19,46,'PHAR. PAYABLE (Rp.) :'+TRANS(round(PTOTL,0),'##,###,###'),'GR+','b',.F.,.T.
        DO BOXT WITH 22,46,'TOTAL PAYABLE (Rp.) :'+TRANS(round(TOTL,0),'##,###,###'),'GR+','b',.F.,.T.
        *end Firisco 29 Jan 2003: round up

      else
         *do boxi with 12,0,'Enter initial of Disposable item to be dispensed :','dispin','w+','rb','W+','n',.f.,.t.
         DO BOXE WITH 12,0,'Enter initial of Disposable item to be dispensed :','dispin','GR+','R','N','W+',5,.T.,.T.
         
         f10='dispos'
         SELE 10
         set exclu off
         use &dr&f10 inde &dr&f10
         DO CASH406p
         if dispk=space(5)
            loop
         endif
         SET COLOR TO BG+/B
         @ 9,0 CLEA TO 20,79
         SELE 10
         set exclu off
         use &dr&f10 inde &dr&f10
         SEEK DISPK
         IF .NOT. EOF()
			NMDS=DISP_NAME
            TPDS=DISP_TYPE
            SLUN=TRIM(SELL_UNIT)+' '+TRIM(DISP_QANT)+' '+TRIM(DISP_UNIT)
            SEUN=SELL_UNIT
            EMDS=EMPLOYEE

	        IF TPPAT='0' .OR. TPPAT='9' .OR. TPPAT='G' .OR. TPPAT='S'
           		UNPS=EMP_PRICE
         	ELSE
          		UNPS=SALE_PRICE
         	ENDIF

            UNNI=DISP_UNIT
            QANT=DISP_QANT
            HLDS=HEALTHLINE
            msds=med_s

            DO BOXT WITH 9,0,ALLTRIM(NMDS)+' '+ALLTRIM(TPDS)+'  '+SLUN,'W+','B',.F.,.F.
            DO BOXT WITH 11,0,'Price : (Rp.) '+TRANS(UNPS,'##,###,###')+' Per '+alltrim(seun),'bg+','b',.F.,.T.
            DO BOXT WITH 11,56,SEUN,'bg+','B',.F.,.F.
            DO BOXN WITH 11,39,'Quantity : ','DQNT','999','BG+','B','W+','N','999','1',.F.,.F.
            TOTPR=UNPS*DQNT
            DO BOXT WITH 14,0,'TOTAL PRICE (Rp.) :'+TRANS(TOTPR,'##,###,###'),'w+','r',.F.,.T.
            do box2 with 14,40,'Do You Want To :','CONFIRM','MODIFY','gr+','r','W+','N',PL7,.F.,.t.
            IF PL7=2
               loop
            ELSE

	            NDISP=NDISP+1

    	        IF (TPPAT='0' .OR. TPPAT='9' .OR. TPPAT='G' .OR. TPPAT='S') .AND. KDPAT<>'P02465' .AND. KDPAT<>'P02466' .AND. KDPAT<>'P02523'
        	    	IF EMDS .AND. (TPPAT='0' .OR. TPPAT='9' .OR. TPPAT='G')
                  		HLRES=.F.
                  		HPRIC=0
                  		PPRIC=0
                  		MPRIC=0
                  		MSRES=.F.
                  		nVAT=0
               		ELSE
                  		HLRES=.F.
                  		HPRIC=0
                  		PPRIC=TOTPR
                  		MPRIC=0
                  		MSRES=.F.
                  		nVAT=(1 * TOTPR)
               		ENDIF
            	ELSE
               		IF HLDS .AND. HEALTH .AND. .NOT. HLVOID
                  		HLRES=.T.
                  		HPRIC=TOTPR
                  		PPRIC=0
                  		MPRIC=0
                  		MSRES=.F.
                  		nVAT=(1 * TOTPR)
               		ELSE
                  		IF MDS .and. msds
                     		HLRES=.F.
                     		HPRIC=0
                     		MPRIC=TOTPR
                     		PPRIC=0
                     		MSRES=.T.
                     		nVAT=(1 * TOTPR)
                  		ELSE
                     		HLRES=.F.
                     		HPRIC=0
                     		PPRIC=TOTPR
                     		MPRIC=0
                     		MSRES=.F.
                     		nVAT=(1 * TOTPR)
                  		ENDIF
               		ENDIF
            	ENDIF
            	sele 6
            	DO phads with 'PC'
	
	            *Start Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT
    	        if PPRIC<>0
	    	        TOTL=TOTL+PPRIC+nVAT
    	    	    PTOTL=PTOTL+PPRIC+nVAT
	            else
		            TOTL=TOTL+PPRIC
    		        PTOTL=PTOTL+PPRIC
    	    	endif
	    	    *End Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT
    
          	endif
		else
        	store space(25) to nmds
          	store space(16) to tpds,slun,seun,unni,qant
          	store 0 to unps,dqnt
          	store .f. to hlds,msds
          	DO BOXE  WITH 9,0,"DISPOSABLE NAME :",'NMDS','BG+','B','W+','N',16,.F.,.F.
          	DO BOXN WITH 11,0,'Price (Rp.) : ','unps','99,999,999','BG+','B','W+','N','10000000','0',.F.,.F.
          	DO BOXN WITH 11,39,'Quantity : ','DQNT','999','BG+','B','W+','N','999','1',.F.,.F.
          	TOTPR=UNPS*DQNT
          	DO BOXT WITH 14,0,'TOTAL PRICE (Rp.) :'+TRANS(TOTPR,'##,###,###'),'W+','R',.F.,.T.
          	do box2 with 14,40,'Do You Want To :','CONFIRM','MODIFY','gr+','r','W+','N',PL7,.F.,.t.
          	IF PL7=2
            	loop
          	ELSE
            	HLRES=.F.
             	HPRIC=0
             	MPRIC=0
             	PPRIC=TOTPR
             	MSRES=.F.
             	nVAT=(1 * TOTPR)
          	ENDIF
          	SELE 6
          	DO phads with 'PC'

            *Start Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT
            if PPRIC<>0
	            TOTL=TOTL+PPRIC+nVAT
    	        PTOTL=PTOTL+PPRIC+nVAT
            else
	            TOTL=TOTL+PPRIC
    	        PTOTL=PTOTL+PPRIC
    	    endif
    	    *End Firisco 29 Jan 2003: bila PPRIC > 0, maka PPRIC ditambah dengan VAT

      endif

      *start Firisco 29 Jan 2003: round up
      DO BOXT WITH 19,46,'PHAR. PAYABLE (Rp.) :'+TRANS(round(PTOTL,0),'##,###,###'),'GR+','B',.F.,.T.
      DO BOXT WITH 22,46,'TOTAL PAYABLE (Rp.) :'+TRANS(round(TOTL,0),'##,###,###'),'GR+','B',.F.,.T.
      *end Firisco 29 Jan 2003: round up

      ENDIF
      SET COLOR TO BG+/B
      @ 9,0 CLEA TO 18,79
      @ 20,0 CLEA TO 24,45
      DO BOX2 WITH 22,0,'Other Drugs or Disposable items :','YES','NO','gr+','r','W+','N',PL8,.F.,.t.

      if pl8=2
         anod=.f.
      endif
   ENDDO
   pde=.t.

   do while pde
      SET COLOR TO BG+/B
      @ 9,0 CLEA TO 24,79
      DO BOXF WITH 9,0,"REVIEW THE INVOICE. Type 'Esc' if correct, 'Enter' To Delete one item",'GR+','R','GR+*',.F.,.T.
      DO BOXT WITH 22,46,'TOTAL PAYABLE (Rp.) :'+TRANS(round(totl,0),'##,###,###'),'GR+','B',.F.,.T.
      GO TOP
      CNT=RECCOUNT()
      DECLARE PPRC[CNT]
      declare PHAc[cnt]
      declare fil1[cnt]
      declare recn[cnt]
      cr=0
      go top
      do while .not. eof()
         cr=cr+1

       	PPRC[CR]=PHAR_PAY
       	PAY_VAT=PHAR_PAY

         PHAc[cr]=PHAR_CODE
         
         *start Firisco 29 Jan 2003: round up
         fil1[cr]=PHAR_CODE+CHR(179)+SPACE(2)+PHAR_NAME+PHAR_TYPE+PHAR_QANT+' '+CHR(179)+' '+str(PHAR_X,4)+space(1)+CHR(179)+trans(SALE_PRICE,'#,###,###')+' '+CHR(179)+' '+TRANS(round(PAY_VAT,0),'##,###,###')
         *end Firisco 29 Jan 2003: round up

         recn[cr]=recno()
         skip
      enddo
      set color to w+/b
      @ 17,0 to 21,79 double
      set colo to g+/B,W+/N
      pilih=achoice(18,2,20,76,fil1)
      IF LASTKEY()=13
         recdel=recn[pilih]
         PPRIC=PPRC[PILIH]
         sele 6
         go recdel
         @ 12,0 clea to 16,79
         do box2 with 12,0,'Delete item '+alltrim(PHAR_NAME)+' '+ALLTRIM(PHAR_TYPE)+' :','YES','NO','w+','b','W+','n',pl10,.f.,.f.
         if pl10=1
            STORE .T. TO PDE,PDEL
            if rec_lock(0)
               DELE
            ENDIF
            UNLOCK

            *start Firisco 29 Jan 2003: round up
            totl=round(totl-PPRIC,0)
            ptotl=round(ptotl-ppric,0)
            *end Firisco 29 Jan 2003: round up

            SELE 6
            IF NET_USE("&DR&F6",.T.,'6',10)
               PACK
            ENDIF
            SET EXCLU OFF
            STOR .F. TO PDE
         else
            STOR .F. TO PDE, PDEL
         endif
      else
         STOR .F. TO PDE, PDEL
      endif
   enddo
   SET COLOR TO BG+/B
   @ 9,0 CLEA TO 21,79
   @ 22,0 CLEA TO 24,45
   IF PDEL
      DO BOX2 WITH 9,0,'DO YOU WANT TO REPLACE DELETED ITEMS ?','YES','NO','GR+','RB','GR+','N',PL11,.F.,.T.
      IF PL11=1
         complt=.f.
         LOOP
      ELSE
         COMPLT=.T.
      ENDIF
   ELSE
      COMPLT=.T.
   Endif
enddo
RETU

